package wdtools

import (
	"encoding/json"
	"reflect"
	"testing"
	_ "gitee.com/yutiandou/wdtools/wdevent"
	_ "gitee.com/yutiandou/wdtools/wdlog"
	_ "gitee.com/yutiandou/wdtools/wdmail"
	_ "gitee.com/yutiandou/wdtools/wdstruct"
	_ "gitee.com/yutiandou/wdtools/wdsys"
	_ "gitee.com/yutiandou/wdtools/wdutil"
)

func TestStruct(t *testing.T) {
	b := Bbb{Name:"hehe"}
	a := Aaa{
		Name: "haha",
		BC:   b,
	}
	data,_ := json.Marshal(a)

	aaa := new(Aaa)
	json.Unmarshal(data,aaa)

	value := reflect.TypeOf(aaa.BC)
	println(value.Name())
}


type Aaa struct {
	Name string
	BC interface{}
}

type Bbb struct {
	Name string
}

type Ccc struct {
	Age string
}